package com.crm.jdy.service.drp;

import com.crm.jdy.common.dto.WDisorInfoDto;
import com.crm.jdy.common.mapper.FRecordInfoMapper;
import com.crm.jdy.common.pojo.TeamInfo;
import com.crm.jdy.common.pojo.WDisorInfo;
import com.crm.jdy.common.mapper.WDisorInfoMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:退库列表信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class WDisorInfoServiceImpl  extends ServiceImpl<WDisorInfoMapper,WDisorInfo> implements WDisorInfoService  {

    @Autowired
    WDisorInfoMapper fRecordInfoMapper;

    @Override
    public boolean removeWDisorInfo(String disorId) {
        return fRecordInfoMapper.deleteById(disorId) > 0;
    }

    @Override
    public boolean addWDisorInfo(WDisorInfo projectInfo) {
        return fRecordInfoMapper.insert(projectInfo) > 0;
    }

    @Override
    public boolean updateWDisorInfo(WDisorInfo projectInfo) {
        return fRecordInfoMapper.updateById(projectInfo) > 0;
    }

    @Override
    public PageInfo<WDisorInfo> seleteWDisorInfo(WDisorInfoDto projectInfoDto) {
        PageHelper.startPage( projectInfoDto.getCurrentPage(),projectInfoDto.getPageSize());
        List<WDisorInfo> bookList = fRecordInfoMapper.seleteWDisorInfo(projectInfoDto);
        PageInfo<WDisorInfo> pageInfo = new PageInfo<WDisorInfo>(bookList);
        return pageInfo;
    }
}